<html>
<head><meta charset="utf-8"><title>LocalDefId instead of DefId where possible · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html">LocalDefId instead of DefId where possible</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="193262825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193262825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193262825">(Apr 07 2020 at 23:57)</a>:</h4>
<p>I gave a first try to <a href="https://github.com/rust-lang/rust/issues/70853" title="https://github.com/rust-lang/rust/issues/70853">https://github.com/rust-lang/rust/issues/70853</a> with <a href="https://github.com/rust-lang/rust/pull/70909" title="https://github.com/rust-lang/rust/pull/70909">https://github.com/rust-lang/rust/pull/70909</a><br>
I know its really a tiny change compared to whats needed but i wanted to start with an easy-to-discuss change so that i can be confident i am not heading in the wrong direction.</p>



<a name="193262839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193262839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193262839">(Apr 07 2020 at 23:57)</a>:</h4>
<p>oh it's fine to do it in steps</p>



<a name="193263019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193263019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193263019">(Apr 08 2020 at 00:00)</a>:</h4>
<p>Yep, the issue implies really a lot of tiny changes all over the place. Doing that in one go is pretty much unfeasible imo.</p>



<a name="193263072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193263072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193263072">(Apr 08 2020 at 00:01)</a>:</h4>
<p>Thanks for the  quick review!</p>



<a name="193263158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193263158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193263158">(Apr 08 2020 at 00:02)</a>:</h4>
<p>by the nit I mean <a href="https://github.com/rust-lang/rust/pull/70909#discussion_r405181950" title="https://github.com/rust-lang/rust/pull/70909#discussion_r405181950">https://github.com/rust-lang/rust/pull/70909#discussion_r405181950</a> btw</p>



<a name="193263165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193263165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193263165">(Apr 08 2020 at 00:02)</a>:</h4>
<p>the maps thing can be done later</p>



<a name="193263216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193263216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193263216">(Apr 08 2020 at 00:03)</a>:</h4>
<p>Ok, i'll keep that in mind.</p>



<a name="193318865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193318865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193318865">(Apr 08 2020 at 13:25)</a>:</h4>
<p>About <a href="https://github.com/rust-lang/rust/pull/70909" title="https://github.com/rust-lang/rust/pull/70909">https://github.com/rust-lang/rust/pull/70909</a>, <strong>eddyb</strong> you approved but what are the next steps? Shall I push more commits to it? Or wait for that to be merged first and do another PR?</p>



<a name="193318982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193318982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193318982">(Apr 08 2020 at 13:26)</a>:</h4>
<p>wait for it to be merged, unless you have more commits ready and it's not in a rollup or something</p>



<a name="193326465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193326465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193326465">(Apr 08 2020 at 14:19)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> yeah so I guess feel free to add commits to it until <a href="https://buildbot2.rust-lang.org/homu/queue/rust" title="https://buildbot2.rust-lang.org/homu/queue/rust">https://buildbot2.rust-lang.org/homu/queue/rust</a> shows your PR is getting close to being tested - right now "the tree is closed" probably because of some GitHub Pages breakage, so nothing is landed anyway</p>



<a name="193328170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193328170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193328170">(Apr 08 2020 at 14:30)</a>:</h4>
<p>Thanks!</p>



<a name="193328310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193328310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193328310">(Apr 08 2020 at 14:31)</a>:</h4>
<p>I am continuing to work locally for now but I have a question. Should <code>as_local_hir_id</code> in librustc_hir and librustc_middle take a <code>LocalDefId</code> as argument instead of a bare <code>DefId</code>?</p>



<a name="193328726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193328726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193328726">(Apr 08 2020 at 14:34)</a>:</h4>
<p>According to the issue description:</p>
<blockquote>
<p>you are more likely to see older idioms (e.g., tcx.as_local_hir_id(def_id).unwrap()). Code like this should be refactored to take a LocalDefId instead of a DefId and their caller made responsible for asserting that a given DefId is local.</p>
</blockquote>



<a name="193328919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193328919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193328919">(Apr 08 2020 at 14:35)</a>:</h4>
<p>yeah</p>



<a name="193329263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193329263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193329263">(Apr 08 2020 at 14:38)</a>:</h4>
<p>Cool because all those calls to <code>.as_local_hir_id(def_id.to_def_id())</code> are making me crazy</p>



<a name="193329356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193329356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193329356">(Apr 08 2020 at 14:39)</a>:</h4>
<p>I mean, i need to add the <code>.to_def_id</code> temporarily so that i can progress step by step, but i want to clean this up</p>



<a name="193330581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193330581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193330581">(Apr 08 2020 at 14:48)</a>:</h4>
<p>btw, if <code>def_id: DefId</code>, then <code>.as_local_hir_id(def_id).unwrap())</code> should be <code>.as_local_hir_id(def_id.expect_local())</code> - it shouldn't need to return <code>Option</code> itself if the input is <code>LocalDefId</code></p>



<a name="193337438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193337438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193337438">(Apr 08 2020 at 15:36)</a>:</h4>
<p>Noted.</p>



<a name="193339726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193339726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193339726">(Apr 08 2020 at 15:51)</a>:</h4>
<p>I tried to change <code>local_def_id(...)</code> to return a <code>LocalDefId</code>, but its breaking literally everywhere. Especially in calls to <code>tcx.generics_of()</code> <code>tcx.typeof()</code>, <code>tcx.variances_of()</code>, etc... Should those methods changed to only accept a <code>LocalDefId</code>? If not it implies adding <code>.to_def_id()</code> everywhere?</p>



<a name="193340017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193340017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193340017">(Apr 08 2020 at 15:53)</a>:</h4>
<p>Those queries work fine for cross-crate <code>DefId</code>'s. When queries are called on cross-crate <code>DefId</code>'s they often just get dispatched to a different method.</p>



<a name="193340161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193340161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193340161">(Apr 08 2020 at 15:54)</a>:</h4>
<p>I wish I had seen this PR earlier. I think this could simplify my PR to add more DefKinds</p>



<a name="193340618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193340618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193340618">(Apr 08 2020 at 15:57)</a>:</h4>
<p>So, its my first contribution so i slowly understanding how to compiler works. But for example, i tried to look for the implementation of <code>variances_of</code> and i found something in <code>src/librustc_typeck/variance/mod.rs</code>. And the first line of variances_of is<code>tcx.hir().as_local_hir_id(item_def_id).expect("expected local def-id")</code></p>



<a name="193340711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193340711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193340711">(Apr 08 2020 at 15:58)</a>:</h4>
<p>It sounds that this one should accept a LocalDefId? Or is there another implementation for cross-crate queries somewhere that i missed?</p>



<a name="193340721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193340721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193340721">(Apr 08 2020 at 15:58)</a>:</h4>
<p>For example <code>generics_of</code> for local <code>DefId</code>'s is at <a href="https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_typeck/collect.rs#L66" title="https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_typeck/collect.rs#L66">https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_typeck/collect.rs#L66</a>, while <code>generics_of</code> for cross-crate <code>DefId</code>'s is at <a href="https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L92" title="https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L92">https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L92</a></p>



<a name="193340749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193340749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193340749">(Apr 08 2020 at 15:58)</a>:</h4>
<p>Oh cool i'll take a look to those</p>



<a name="193340883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193340883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193340883">(Apr 08 2020 at 15:59)</a>:</h4>
<p>So basically, i am doomed and I have to add calls to <code>.to_def_id()</code> all over the place :'(</p>



<a name="193351181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351181">(Apr 08 2020 at 17:17)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> <span class="user-mention" data-user-id="119009">@eddyb</span> Why don't we make the helper methods on <code>TyCtxt</code> that look up query results take an <code>impl Into&lt;DefId&gt;</code> instead of a <code>DefId</code>?</p>



<a name="193351232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351232">(Apr 08 2020 at 17:17)</a>:</h4>
<p>Also <span class="user-mention" data-user-id="281572">@marmeladema</span> nice job so far! Thanks for taking this on.</p>



<a name="193351242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351242">(Apr 08 2020 at 17:17)</a>:</h4>
<p>oh right I noted that down somewhere</p>



<a name="193351252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351252">(Apr 08 2020 at 17:17)</a>:</h4>
<p>the <code>Into</code> thing</p>



<a name="193351267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351267">(Apr 08 2020 at 17:17)</a>:</h4>
<p>/me then proceeded to forget it</p>



<a name="193351341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351341">(Apr 08 2020 at 17:18)</a>:</h4>
<p>you'd likely want a different trait just so <code>.into()</code> doesn't become prevalent idk</p>



<a name="193351385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351385">(Apr 08 2020 at 17:18)</a>:</h4>
<p>but generally you could make all the queries have an <code>impl Into</code> wrapper if we wanted to</p>



<a name="193351395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351395">(Apr 08 2020 at 17:18)</a>:</h4>
<p>maybe a separate trait</p>



<a name="193351472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193351472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193351472">(Apr 08 2020 at 17:19)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> this is easier due to the single-argument nature of queries (which is mostly because Rust has no VG, although the macros could let us allow more arities, hmm :P</p>



<a name="193353090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193353090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193353090">(Apr 08 2020 at 17:31)</a>:</h4>
<p>I don't have a problem with <code>Into</code>, but we can take a poll re: <code>Into</code> vs a custom trait at some point.</p>



<a name="193358184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193358184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193358184">(Apr 08 2020 at 18:15)</a>:</h4>
<p>So about the trait. In the link for cross-crate <code>generics_of</code> defined here: <a href="https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L72" title="https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L72">https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L72</a><br>
there is the <code>IntoArgs</code> trait implemented for <code>DefId</code>. But i don't think the same mechanism is used for local crate?</p>



<a name="193358400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193358400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193358400">(Apr 08 2020 at 18:17)</a>:</h4>
<p>Because i thought i could maybe implement it for <code>LocalDefId</code></p>



<a name="193359060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359060">(Apr 08 2020 at 18:22)</a>:</h4>
<p>that's unrelated</p>



<a name="193359114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359114">(Apr 08 2020 at 18:23)</a>:</h4>
<p>Ok, sorry i am a bit lost :/</p>



<a name="193359146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359146">(Apr 08 2020 at 18:23)</a>:</h4>
<p>that <code>IntoArgs</code> is just a local hack</p>



<a name="193359159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359159">(Apr 08 2020 at 18:23)</a>:</h4>
<p>nobody using the query system would see it</p>



<a name="193359180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359180">(Apr 08 2020 at 18:23)</a>:</h4>
<p>that trait is private to that module</p>



<a name="193359249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359249">(Apr 08 2020 at 18:24)</a>:</h4>
<p>and it just does a simple job</p>



<a name="193359583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359583">(Apr 08 2020 at 18:26)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> this is the <code>TyCtxt::generics_of</code> function <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/query/plumbing.rs#L424" title="https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/query/plumbing.rs#L424">https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/query/plumbing.rs#L424</a></p>



<a name="193359592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359592">(Apr 08 2020 at 18:26)</a>:</h4>
<p>and every ohter query entry-point</p>



<a name="193359606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359606">(Apr 08 2020 at 18:26)</a>:</h4>
<p>see also <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/query/plumbing.rs#L461" title="https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/query/plumbing.rs#L461">https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/query/plumbing.rs#L461</a> just below</p>



<a name="193359642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359642">(Apr 08 2020 at 18:27)</a>:</h4>
<p>so yeah you could replace <code>key: $K</code> by <code>key: impl Into&lt;$K&gt;</code></p>



<a name="193359666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359666">(Apr 08 2020 at 18:27)</a>:</h4>
<p>and then <code>key.into()</code> in the body</p>



<a name="193359711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193359711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193359711">(Apr 08 2020 at 18:27)</a>:</h4>
<p>actually the first one calls the second one so maybe don't use <code>.into()</code> in the first one</p>



<a name="193360795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193360795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193360795">(Apr 08 2020 at 18:35)</a>:</h4>
<p>Why is it better to call <code>.into()</code> in the second one rather than in the first one?</p>



<a name="193360856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193360856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193360856">(Apr 08 2020 at 18:35)</a>:</h4>
<p>(I don't mind either, its just not clear to me why one is better than the other)</p>



<a name="193360978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193360978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193360978">(Apr 08 2020 at 18:36)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> it's either both or just in the second one. but if both take <code>impl Into</code>, and the first calls the second, the first doesn't have to call <code>.into()</code> <em>itself</em></p>



<a name="193361019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193361019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193361019">(Apr 08 2020 at 18:36)</a>:</h4>
<p>it can just pass whatever it got, along</p>



<a name="193364839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193364839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193364839">(Apr 08 2020 at 19:06)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> if you want to add more commits to this PR, lmk to r- it <a href="https://github.com/rust-lang/rust/pull/70909#issuecomment-611072623" title="https://github.com/rust-lang/rust/pull/70909#issuecomment-611072623">https://github.com/rust-lang/rust/pull/70909#issuecomment-611072623</a></p>



<a name="193366546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193366546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193366546">(Apr 08 2020 at 19:19)</a>:</h4>
<p>Nah its fine, i'll do another PR.</p>



<a name="193421772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193421772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193421772">(Apr 09 2020 at 08:42)</a>:</h4>
<p>So i have other commits ready, and I originally thought the first PR would be merged by that time but here we are. I fear that if i add more commits, the PR will be so big that i will endup rebasing and fixing big conflicts all the time to keep up with upstream changes. I am not sure how should I proceed.</p>



<a name="193421991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193421991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193421991">(Apr 09 2020 at 08:44)</a>:</h4>
<p>oh yeah it takes a while :P</p>



<a name="193422118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422118">(Apr 09 2020 at 08:46)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> it's prioritized so all we have to do is review it quickly</p>



<a name="193422136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422136">(Apr 09 2020 at 08:46)</a>:</h4>
<p>(if you push to the current PR)</p>



<a name="193422175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422175">(Apr 09 2020 at 08:46)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> wait, do any of those commits change queries to take <code>impl Into</code>?</p>



<a name="193422184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422184">(Apr 09 2020 at 08:47)</a>:</h4>
<p>because <em>that</em> should be a separate PR of its own</p>



<a name="193422192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422192">(Apr 09 2020 at 08:47)</a>:</h4>
<p>Yes ...</p>



<a name="193422203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422203">(Apr 09 2020 at 08:47)</a>:</h4>
<p>it has too many implications outside of the scope of this change</p>



<a name="193422208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422208">(Apr 09 2020 at 08:47)</a>:</h4>
<p>I can have a separate PR for the impl Into</p>



<a name="193422287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422287">(Apr 09 2020 at 08:48)</a>:</h4>
<p>small things can go in the current PR, as long as it's not getting close to the top of <a href="https://buildbot2.rust-lang.org/homu/queue/rust" title="https://buildbot2.rust-lang.org/homu/queue/rust">https://buildbot2.rust-lang.org/homu/queue/rust</a></p>



<a name="193422301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193422301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193422301">(Apr 09 2020 at 08:48)</a>:</h4>
<p>just don't forget to ping me here so I go review the PR again</p>



<a name="193451332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193451332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193451332">(Apr 09 2020 at 13:40)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> Unfortunately, I don't there is any good way around the who rebasing/conflicts problem. Almost all of my refactoring PRs have had to be rebased multiple times. It's a struggle.</p>



<a name="193453437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193453437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193453437">(Apr 09 2020 at 13:57)</a>:</h4>
<p>Ok, then, everyone is in the same boat i guess :) I'll do the PR for the Into DefId first anyway as its kind of needed before further changes</p>



<a name="193458363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193458363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193458363">(Apr 09 2020 at 14:34)</a>:</h4>
<p>Here we go <a href="https://github.com/rust-lang/rust/pull/70956" title="https://github.com/rust-lang/rust/pull/70956">https://github.com/rust-lang/rust/pull/70956</a></p>



<a name="193560339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193560339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193560339">(Apr 10 2020 at 11:34)</a>:</h4>
<p>I have split my next PR in two to make progress while the discussion for <code>`impl Into&lt;$K&gt;</code> is going on: <a href="https://github.com/rust-lang/rust/pull/70986" title="https://github.com/rust-lang/rust/pull/70986">https://github.com/rust-lang/rust/pull/70986</a></p>



<a name="193560506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193560506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193560506">(Apr 10 2020 at 11:38)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> do you want this to land first, or do you want to simplify it if we do the <code>impl Into</code> stuff?</p>



<a name="193560545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193560545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193560545">(Apr 10 2020 at 11:39)</a>:</h4>
<p>this does not rely on the <code>impl Into</code> stuff so i can be merged right now</p>



<a name="193560733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193560733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193560733">(Apr 10 2020 at 11:42)</a>:</h4>
<p>The next commit, which is not part of this PR, is to change the return type of <code>local_def_id()</code> function but it implies adding <code>.to_def_id()</code> all over the place. Its "only" for this commit that i wanted to add the <code>impl Into</code> stuff. To keep the code base cleaner and to save me the burden of fixing hundreds of errors manually.</p>



<a name="193560964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193560964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193560964">(Apr 10 2020 at 11:46)</a>:</h4>
<p>aaah I see</p>



<a name="193561091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193561091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193561091">(Apr 10 2020 at 11:49)</a>:</h4>
<p>And if the <code>impl Into</code> stuff is too controversial, i can call <code>.to_def_id()</code> everywhere I guess.</p>



<a name="193581594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193581594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193581594">(Apr 10 2020 at 15:29)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> you told me a few days ago that once <code>as_local_hir_id</code> takes a <code>LocalDefId</code> then it should not return an <code>Option&lt;&gt;</code> anymore. But how do i get rid of the check for <code>DUMMY_HIR_ID</code>? Right now the code does:<br>
<code>if hir_id != DUMMY_HIR_ID { Some(hir_id) } else { None }</code></p>



<a name="193581638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193581638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193581638">(Apr 10 2020 at 15:29)</a>:</h4>
<p>ughhh <code>DUMMY_HIR_ID</code> shouldn't exist</p>



<a name="193581645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193581645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193581645">(Apr 10 2020 at 15:29)</a>:</h4>
<p>is it really constructed in practice?</p>



<a name="193581773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193581773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193581773">(Apr 10 2020 at 15:30)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> try changing the code (without modifying signatures) to <code>assert_ne!(hir_id, DUMMY_HIR_ID)</code> and see if tests still pass</p>



<a name="193581912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193581912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193581912">(Apr 10 2020 at 15:31)</a>:</h4>
<p>Ok thanks, i'll try that</p>



<a name="193594488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193594488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193594488">(Apr 10 2020 at 17:23)</a>:</h4>
<p>I have 3 failing tests:<br>
    [ui] ui/save-analysis/issue-68621.rs<br>
    [ui] ui/type-alias-impl-trait/issue-63279.rs<br>
    [ui] ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs</p>



<a name="193594757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193594757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193594757">(Apr 10 2020 at 17:25)</a>:</h4>
<p>huuuh</p>



<a name="193594915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193594915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193594915">(Apr 10 2020 at 17:26)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/68744/files#diff-1d1b0d29a2e8da97c6bfb6e364d920c7L840-R840" title="https://github.com/rust-lang/rust/pull/68744/files#diff-1d1b0d29a2e8da97c6bfb6e364d920c7L840-R840">https://github.com/rust-lang/rust/pull/68744/files#diff-1d1b0d29a2e8da97c6bfb6e364d920c7L840-R840</a></p>



<a name="193594933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193594933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193594933">(Apr 10 2020 at 17:27)</a>:</h4>
<p>this looks like the wrong fix if I had to guess</p>



<a name="193595156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193595156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193595156">(Apr 10 2020 at 17:28)</a>:</h4>
<p>yeah it's impossible <a href="https://github.com/rust-lang/rust/blob/8926bb497d9b127eb318aea5aed0e745d8381591/src/librustc_passes/hir_id_validator.rs#L146-L154" title="https://github.com/rust-lang/rust/blob/8926bb497d9b127eb318aea5aed0e745d8381591/src/librustc_passes/hir_id_validator.rs#L146-L154">https://github.com/rust-lang/rust/blob/8926bb497d9b127eb318aea5aed0e745d8381591/src/librustc_passes/hir_id_validator.rs#L146-L154</a></p>



<a name="193595199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193595199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193595199">(Apr 10 2020 at 17:29)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> so the bug is that <code>DUMMY_HIR_ID</code> exists and things pass it around (but it doesn't come from the HIR)</p>



<a name="193595311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193595311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193595311">(Apr 10 2020 at 17:30)</a>:</h4>
<p>ah no I found it</p>



<a name="193595419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193595419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193595419">(Apr 10 2020 at 17:31)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/0c835b0cca83fe21090562603e4bda77c183ace3/src/librustc_ast_lowering/lib.rs#L569-L595" title="https://github.com/rust-lang/rust/blob/0c835b0cca83fe21090562603e4bda77c183ace3/src/librustc_ast_lowering/lib.rs#L569-L595">https://github.com/rust-lang/rust/blob/0c835b0cca83fe21090562603e4bda77c183ace3/src/librustc_ast_lowering/lib.rs#L569-L595</a></p>



<a name="193595585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193595585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193595585">(Apr 10 2020 at 17:32)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> so you could add an <code>assert_ne!(ast_node_id, DUMMY_NODE_ID)</code> in that function I just linked</p>



<a name="193595618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193595618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193595618">(Apr 10 2020 at 17:32)</a>:</h4>
<p>to see when the AST is malformed</p>



<a name="193595628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193595628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193595628">(Apr 10 2020 at 17:32)</a>:</h4>
<p>we really shouldn't be allowing this anymore...</p>



<a name="193595851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193595851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193595851">(Apr 10 2020 at 17:34)</a>:</h4>
<p>Ok i added the new assert and i am recompiling/rerunning the tests</p>



<a name="193600693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193600693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193600693">(Apr 10 2020 at 18:18)</a>:</h4>
<p><a href="https://paste.ee/p/u8Vb4" title="https://paste.ee/p/u8Vb4">https://paste.ee/p/u8Vb4</a><br>
does that help?</p>



<a name="193601292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193601292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193601292">(Apr 10 2020 at 18:25)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> that's not in <code>rustc_ast_lowering</code></p>



<a name="193601568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193601568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193601568">(Apr 10 2020 at 18:28)</a>:</h4>
<p>hum, i added the assert as the first line in the function oO</p>



<a name="193602004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193602004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193602004">(Apr 10 2020 at 18:32)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> just means it doesn't get triggered</p>



<a name="193602017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193602017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193602017">(Apr 10 2020 at 18:32)</a>:</h4>
<p>which means we can remove <code>DUMMY_HIR_ID</code>, maybe</p>



<a name="193603624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193603624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193603624">(Apr 10 2020 at 18:47)</a>:</h4>
<p>Should it be a separate issue?</p>



<a name="193604499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193604499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193604499">(Apr 10 2020 at 18:55)</a>:</h4>
<p>Also, should <code>Res::Def(DefKind, LocalDefId)</code>? Instead of DefId</p>



<a name="193604747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193604747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193604747">(Apr 10 2020 at 18:57)</a>:</h4>
<p>no, because it contains cross-crate things too</p>



<a name="193604772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193604772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193604772">(Apr 10 2020 at 18:57)</a>:</h4>
<p>like when you write <code>String</code>, that's <code>Res::Def(DefKind::Struct, DefId(alloc::string::String))</code></p>



<a name="193605166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193605166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193605166">(Apr 10 2020 at 19:01)</a>:</h4>
<p>ok</p>



<a name="193605192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193605192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193605192">(Apr 10 2020 at 19:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281572">marmeladema</span> <a href="#narrow/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible/near/193603624" title="#narrow/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible/near/193603624">said</a>:</p>
<blockquote>
<p>Should it be a separate issue?</p>
</blockquote>
<p>probably, yeah</p>



<a name="193654038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193654038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193654038">(Apr 11 2020 at 10:48)</a>:</h4>
<p>I am trying to go forward with accepting direct <code>LocalDefId</code> as argument to <code>as_local_hir_id()</code> but it forces to add call to <code>.expect_local()</code> everywhere because there not a lot of places that already uses <code>LocalDefId</code></p>



<a name="193654072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193654072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193654072">(Apr 11 2020 at 10:48)</a>:</h4>
<p>I guess some types that hold a DefId could hold a LocalDefId but i am don't know how to recognize those cases</p>



<a name="193654372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193654372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193654372">(Apr 11 2020 at 10:56)</a>:</h4>
<p>For example, in librustc_middle, should FnDef or Closure hold a LocalDefId instead of a DefId <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="193655328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193655328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193655328">(Apr 11 2020 at 11:22)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> yeah it's tricky but for example types can't use <code>LocalDefId</code></p>



<a name="193655334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193655334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193655334">(Apr 11 2020 at 11:22)</a>:</h4>
<p>because they work cross-crate</p>



<a name="193655340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193655340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193655340">(Apr 11 2020 at 11:22)</a>:</h4>
<p>it's mostly things that need the HIR</p>



<a name="193655349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193655349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193655349">(Apr 11 2020 at 11:23)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> basically you can bubble up an <code>expect_local</code> through functions and then see if the data type always results in <code>expect_local</code> getting called</p>



<a name="193681523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193681523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193681523">(Apr 11 2020 at 21:54)</a>:</h4>
<p>I am getting a panic during <code>./x.py test</code> but the backtraces don't contain file and line number, is there a way to enable those debug info?</p>



<a name="193681887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193681887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193681887">(Apr 11 2020 at 22:03)</a>:</h4>
<p><code>debuginfo-level =  1</code> in <code>config.toml</code></p>



<a name="193681989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193681989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193681989">(Apr 11 2020 at 22:05)</a>:</h4>
<p>great thanks</p>



<a name="193711795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193711795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193711795">(Apr 12 2020 at 12:48)</a>:</h4>
<p>So I have a branch ready where <code>as_local_hir_id</code> accepts <code>LocalDefId</code> instead of a <code>DefId</code> but it still rely on the <code>impl Into&lt;$K&gt;</code> for queries.</p>



<a name="193711807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193711807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193711807">(Apr 12 2020 at 12:49)</a>:</h4>
<p>And <code>as_local_hir_id</code> still returns an <code>Option&lt;&gt;</code> because I haven't get rid of <code>DUMMY_HIR_ID</code> yet.</p>



<a name="193711876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193711876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193711876">(Apr 12 2020 at 12:51)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> but the assert you added <code>rustc_ast_lowering</code> never failed right?</p>



<a name="193711906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193711906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193711906">(Apr 12 2020 at 12:52)</a>:</h4>
<p>so the problem is things passing <code>DUMMY_HIR_ID</code> where a <code>HirId</code> is expected</p>



<a name="193711930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193711930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193711930">(Apr 12 2020 at 12:52)</a>:</h4>
<p>And since <a href="https://github.com/rust-lang/rust/pull/70961" title="https://github.com/rust-lang/rust/pull/70961">https://github.com/rust-lang/rust/pull/70961</a> seems to slow. So i might add calls to <code>to_def_id()</code> everywhere. Should not take too long now that i have properly configured my code editor :P</p>



<a name="193711957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193711957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193711957">(Apr 12 2020 at 12:53)</a>:</h4>
<p>So the 3 failings tests all fail in <code>has_typeck_tables</code> from <code>librustc_typeck/check/mod.rs</code></p>



<a name="193711961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193711961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193711961">(Apr 12 2020 at 12:53)</a>:</h4>
<p>And yes, the assert in ast lowering never triggered, only the one in <code>as_local_hir_id</code></p>



<a name="193712003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712003">(Apr 12 2020 at 12:54)</a>:</h4>
<p>did GH search just break? <a href="https://github.com/rust-lang/rust/search?q=DUMMY_HIR_ID" title="https://github.com/rust-lang/rust/search?q=DUMMY_HIR_ID">https://github.com/rust-lang/rust/search?q=DUMMY_HIR_ID</a></p>



<a name="193712017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712017">(Apr 12 2020 at 12:54)</a>:</h4>
<p>it works for me?</p>



<a name="193712030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712030">(Apr 12 2020 at 12:55)</a>:</h4>
<p>it says " We couldn’t find any code matching 'DUMMY_HIR_ID' in rust-lang/rust "</p>



<a name="193712040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712040">(Apr 12 2020 at 12:55)</a>:</h4>
<p>this works though <a href="https://github.com/search?q=DUMMY_HIR_ID+repo%3Arust-lang%2Frust+extension%3Ars&amp;type=Code&amp;ref=advsearch&amp;l=&amp;l=" title="https://github.com/search?q=DUMMY_HIR_ID+repo%3Arust-lang%2Frust+extension%3Ars&amp;type=Code&amp;ref=advsearch&amp;l=&amp;l=">https://github.com/search?q=DUMMY_HIR_ID+repo%3Arust-lang%2Frust+extension%3Ars&amp;type=Code&amp;ref=advsearch&amp;l=&amp;l=</a></p>



<a name="193712060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712060">(Apr 12 2020 at 12:55)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> anyway I'll go through them and let you know which can be easily fixed</p>



<a name="193712115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712115">(Apr 12 2020 at 12:56)</a>:</h4>
<p>if we can replace all of them with valid IDs or <code>Option&lt;HirId&gt;</code>, then we can get rid of <code>DUMMY_HIR_ID</code></p>



<a name="193712119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712119">(Apr 12 2020 at 12:57)</a>:</h4>
<p>or maybe I should do that separately</p>



<a name="193712125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712125">(Apr 12 2020 at 12:57)</a>:</h4>
<p>Here is the "more detailed" backtrace but line numbers are from my local branch: <a href="https://paste.ee/p/0XUZy" title="https://paste.ee/p/0XUZy">https://paste.ee/p/0XUZy</a></p>



<a name="193712172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712172">(Apr 12 2020 at 12:58)</a>:</h4>
<p>And about <code>impl Into&lt;$K&gt;</code>, shall i ignore for now and add calls to <code>to_def_id</code>?</p>



<a name="193712872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712872">(Apr 12 2020 at 13:17)</a>:</h4>
<p>good news :) <a href="https://github.com/rust-lang/rust/pull/70961#issuecomment-612612269" title="https://github.com/rust-lang/rust/pull/70961#issuecomment-612612269">https://github.com/rust-lang/rust/pull/70961#issuecomment-612612269</a></p>



<a name="193712917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193712917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193712917">(Apr 12 2020 at 13:18)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> so you can base your work on that PR :D</p>



<a name="193714912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193714912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193714912">(Apr 12 2020 at 14:16)</a>:</h4>
<p>Oh great!</p>



<a name="193717658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193717658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193717658">(Apr 12 2020 at 15:33)</a>:</h4>
<p>Hu :/ rustdoc tests are failing. Probably because at some point <code>as_local_hir_id</code> returns <code>None</code> because of some <code>DUMMY_HIR_ID</code> somewhere. I think we should remove that dummy id before going further. Its too confusing otherwise.</p>



<a name="193766888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193766888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193766888">(Apr 13 2020 at 12:25)</a>:</h4>
<p>By the way, are we merging <a href="https://github.com/rust-lang/rust/pull/70961" title="https://github.com/rust-lang/rust/pull/70961">https://github.com/rust-lang/rust/pull/70961</a>?</p>



<a name="193766977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/193766977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#193766977">(Apr 13 2020 at 12:26)</a>:</h4>
<p>I kind of wanted some feedback but we don't have to I don't think</p>



<a name="194066586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194066586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194066586">(Apr 15 2020 at 17:42)</a>:</h4>
<p>So i rebased my changes over master but now the compiler is is crashing here: <a href="https://paste.ee/p/7mwBb" title="https://paste.ee/p/7mwBb">https://paste.ee/p/7mwBb</a><br>
Failure seems to b restricted to this specific commit: <a href="https://github.com/marmeladema/rust/commit/3d00f8dfee5e3fb92e7b75a5d7ce58d02dd10a9a" title="https://github.com/marmeladema/rust/commit/3d00f8dfee5e3fb92e7b75a5d7ce58d02dd10a9a">https://github.com/marmeladema/rust/commit/3d00f8dfee5e3fb92e7b75a5d7ce58d02dd10a9a</a><br>
The one before builds and passes the tests properly</p>



<a name="194066853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194066853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194066853">(Apr 15 2020 at 17:44)</a>:</h4>
<p>It crashes in <code>find_entry</code> on this code <code>let node = owner.nodes[id.local_id].as_ref();</code>:</p>
<div class="codehilite"><pre><span></span>thread &#39;rustc&#39; panicked at &#39;index out of bounds: the len is 513 but the index is 980954&#39;, /home/adema/code/rust/src/libcore/slice/mod.rs:2872:10
</pre></div>



<a name="194067145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194067145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194067145">(Apr 15 2020 at 17:46)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> do you have any advises on how to debug my issue? I don't know what to look for :/</p>



<a name="194205107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194205107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194205107">(Apr 15 2020 at 18:06)</a>:</h4>
<p>looking now</p>



<a name="194205496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194205496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194205496">(Apr 15 2020 at 18:10)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> sounds like a <code>HirId</code> was decomposed</p>



<a name="194205578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194205578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194205578">(Apr 15 2020 at 18:10)</a>:</h4>
<p>and the <code>LocalDefId</code> and <code>ItemLocalId</code> are for different defs</p>



<a name="194205663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194205663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194205663">(Apr 15 2020 at 18:11)</a>:</h4>
<p><code>def_id.local_def_index == hir_id.owner.local_def_index</code> can be just <code>def_id == hir_id.owner</code> but that couldn't cause this</p>



<a name="194206049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194206049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194206049">(Apr 15 2020 at 18:14)</a>:</h4>
<p>I'll try that anyway, since i don't have any other idea^^</p>



<a name="194206067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194206067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194206067">(Apr 15 2020 at 18:14)</a>:</h4>
<p>I mean, it's just a nit</p>



<a name="194206154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194206154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194206154">(Apr 15 2020 at 18:15)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> you're sure it's that commit o_O?</p>



<a name="194206295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194206295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194206295">(Apr 15 2020 at 18:16)</a>:</h4>
<p>Well, i'll try again the previous commits, but there is only two commits over master in this branch</p>



<a name="194206311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194206311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194206311">(Apr 15 2020 at 18:16)</a>:</h4>
<p>so its either this one of the one before</p>



<a name="194206639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194206639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194206639">(Apr 15 2020 at 18:19)</a>:</h4>
<p>previous one being this? <a href="https://github.com/rust-lang/rust/commit/a989b80d44863480c9fe54e818f932fd83a0c979" title="https://github.com/rust-lang/rust/commit/a989b80d44863480c9fe54e818f932fd83a0c979">https://github.com/rust-lang/rust/commit/a989b80d44863480c9fe54e818f932fd83a0c979</a></p>



<a name="194206705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194206705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194206705">(Apr 15 2020 at 18:20)</a>:</h4>
<p>yes exactly</p>



<a name="194206799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194206799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194206799">(Apr 15 2020 at 18:21)</a>:</h4>
<p><a href="https://github.com/marmeladema/rust/commit/a989b80d44863480c9fe54e818f932fd83a0c979" title="https://github.com/marmeladema/rust/commit/a989b80d44863480c9fe54e818f932fd83a0c979">https://github.com/marmeladema/rust/commit/a989b80d44863480c9fe54e818f932fd83a0c979</a></p>



<a name="194207548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194207548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194207548">(Apr 15 2020 at 18:27)</a>:</h4>
<p>I am retrying the commit i thought was working</p>



<a name="194207570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194207570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194207570">(Apr 15 2020 at 18:27)</a>:</h4>
<p>lets see</p>



<a name="194207937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194207937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194207937">(Apr 15 2020 at 18:30)</a>:</h4>
<p>this is stumping me</p>



<a name="194207956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194207956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194207956">(Apr 15 2020 at 18:30)</a>:</h4>
<p>there's nothing you did that, at a glance, could ever cause this</p>



<a name="194208203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194208203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194208203">(Apr 15 2020 at 18:32)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> only thing I can think of would be if you got variable shadowing wrong in a critical part of the compiler</p>



<a name="194208280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194208280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194208280">(Apr 15 2020 at 18:33)</a>:</h4>
<p>the first commit touches even less code <em>sigh</em></p>



<a name="194208356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194208356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194208356">(Apr 15 2020 at 18:33)</a>:</h4>
<p>btw pro tip: <a href="https://github.com/marmeladema/rust/commit/3d00f8dfee5e3fb92e7b75a5d7ce58d02dd10a9a?w=1" title="https://github.com/marmeladema/rust/commit/3d00f8dfee5e3fb92e7b75a5d7ce58d02dd10a9a?w=1">https://github.com/marmeladema/rust/commit/3d00f8dfee5e3fb92e7b75a5d7ce58d02dd10a9a?w=1</a> (specifically the <code>?w=1</code> ignores whitespace changes)</p>



<a name="194209091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194209091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194209091">(Apr 15 2020 at 18:38)</a>:</h4>
<p>Yeah i was kind of thinking of a shadowed variable somewhere. But i have not found it yet.</p>



<a name="194209475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194209475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194209475">(Apr 15 2020 at 18:41)</a>:</h4>
<p>wait why is it...</p>



<a name="194209498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194209498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194209498">(Apr 15 2020 at 18:41)</a>:</h4>
<p>that's a weird <code>HirId</code> you have there</p>



<a name="194209521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194209521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194209521">(Apr 15 2020 at 18:42)</a>:</h4>
<p>isn't <code>num::from_str_radix</code> a <code>fn</code>?</p>



<a name="194209573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194209573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194209573">(Apr 15 2020 at 18:42)</a>:</h4>
<p>the <code>HirId</code> should have <code>local_id == ItemLocalId(0)</code></p>



<a name="194209652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194209652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194209652">(Apr 15 2020 at 18:43)</a>:</h4>
<p>btw I got that name from <a href="https://paste.ee/p/7mwBb#s=0&amp;l=410" title="https://paste.ee/p/7mwBb#s=0&amp;l=410">https://paste.ee/p/7mwBb#s=0&amp;l=410</a></p>



<a name="194210054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194210054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194210054">(Apr 15 2020 at 18:45)</a>:</h4>
<p>this is so weird</p>



<a name="194210294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194210294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194210294">(Apr 15 2020 at 18:47)</a>:</h4>
<p>I can confirm that <a href="https://github.com/rust-lang/rust/commit/a989b80d44863480c9fe54e818f932fd83a0c979" title="https://github.com/rust-lang/rust/commit/a989b80d44863480c9fe54e818f932fd83a0c979">a989b80d44863480c9fe54e818f932fd83a0c979</a> buids and passes the tests</p>



<a name="194210436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194210436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194210436">(Apr 15 2020 at 18:48)</a>:</h4>
<p>the only thing I can suggest is to try and figure out if you can <code>debug!</code> the exact accessed <code>HirId</code> and what's happening there</p>



<a name="194210465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194210465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194210465">(Apr 15 2020 at 18:48)</a>:</h4>
<p>I don't see how this could happen</p>



<a name="194210483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194210483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194210483">(Apr 15 2020 at 18:48)</a>:</h4>
<p>not to mention that 980954 is huge</p>



<a name="194210602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194210602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194210602">(Apr 15 2020 at 18:49)</a>:</h4>
<p>Thanks, i'll add debug print everywhere i can :D</p>



<a name="194222968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194222968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194222968">(Apr 15 2020 at 20:28)</a>:</h4>
<div class="codehilite"><pre><span></span>[attrs] id=HirId { owner: DefId(0:678 ~ core[d046]::num[0]::from_str_radix[0]), local_id: 980954 }
[find_entry] id=HirId { owner: DefId(0:678 ~ core[d046]::num[0]::from_str_radix[0]), local_id: 980954 }
</pre></div>



<a name="194223027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194223027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194223027">(Apr 15 2020 at 20:28)</a>:</h4>
<p>oh, <code>DefId</code> debug-prints well :D</p>



<a name="194223206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194223206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194223206">(Apr 15 2020 at 20:30)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> yeah so now you need to figure out how far back that is injected</p>



<a name="194223223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194223223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194223223">(Apr 15 2020 at 20:30)</a>:</h4>
<p>AFAIK that <code>980954</code> is nonsense</p>



<a name="194225147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194225147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194225147">(Apr 15 2020 at 20:47)</a>:</h4>
<div class="codehilite"><pre><span></span>[check_attributes]
    hir_id=HirId { owner: DefId(0:678 ~ core[d046]::num[0]::from_str_radix[0]), local_id: 0 }
    local_def_id(hir_id)=DefId(0:678 ~ core[d046]::num[0]::from_str_radix[0])
[codegen_fn_attrs] id=DefId(0:678 ~ core[d046]::num[0]::from_str_radix[0])
[get_attrs] did=DefId(0:678 ~ core[d046]::num[0]::from_str_radix[0])
[attrs] id=HirId { owner: DefId(0:678 ~ core[d046]::num[0]::from_str_radix[0]), local_id: 980954 }
[find_entry] id=HirId { owner: DefId(0:678 ~ core[d046]::num[0]::from_str_radix[0]), local_id: 980954 }
</pre></div>



<a name="194225644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194225644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194225644">(Apr 15 2020 at 20:51)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> should <code>as_local_def_id (as_local_hir_d(def_id)) == def_id</code>?</p>



<a name="194225678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194225678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194225678">(Apr 15 2020 at 20:51)</a>:</h4>
<p>yes</p>



<a name="194225784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194225784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194225784">(Apr 15 2020 at 20:52)</a>:</h4>
<p>oh right you can assert that very early, whenever the relevant tables are created</p>



<a name="194225821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194225821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194225821">(Apr 15 2020 at 20:52)</a>:</h4>
<p>yeah that was one of my idea</p>



<a name="194226484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194226484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194226484">(Apr 15 2020 at 20:57)</a>:</h4>
<p>anyway yeah <code>check_attributes</code> has the right <code>HirId</code> but the <code>LocalDefId -&gt; HirId</code> table seems broken</p>



<a name="194231874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194231874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194231874">(Apr 15 2020 at 21:45)</a>:</h4>
<p>Surprisingly, sometime when i recompile, the same bug in find_entry happens but with another backtrace</p>



<a name="194231895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194231895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194231895">(Apr 15 2020 at 21:45)</a>:</h4>
<div class="codehilite"><pre><span></span>query stack during panic:
#0 [param_env] processing `cmp::Ordering::Less::{{constant}}#0`
#1 [collect_mod_item_types] collecting item types in module `cmp`
#2 [analysis] running analysis passes on this crate
</pre></div>



<a name="194231934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194231934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194231934">(Apr 15 2020 at 21:45)</a>:</h4>
<p>this is somewhat disturbing :P</p>



<a name="194231994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194231994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194231994">(Apr 15 2020 at 21:46)</a>:</h4>
<p>almost sounds like a miscompilation of rustc</p>



<a name="194232372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194232372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194232372">(Apr 15 2020 at 21:50)</a>:</h4>
<p>is <code>find_entry</code> recursive somehow?</p>



<a name="194232387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194232387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194232387">(Apr 15 2020 at 21:50)</a>:</h4>
<p>no</p>



<a name="194233190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194233190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194233190">(Apr 15 2020 at 21:57)</a>:</h4>
<p>oh i was tricked by the closure in the backtrace</p>



<a name="194235014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194235014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194235014">(Apr 15 2020 at 22:15)</a>:</h4>
<p>whatever the backtrace, local_id is always equal to 980954</p>



<a name="194235042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194235042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194235042">(Apr 15 2020 at 22:15)</a>:</h4>
<p>its like corrupted in an almost predictable way</p>



<a name="194245213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245213">(Apr 16 2020 at 00:27)</a>:</h4>
<p>I did a <code>x.py clean</code> and rebuilt and the crash are still happening</p>



<a name="194245282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245282">(Apr 16 2020 at 00:28)</a>:</h4>
<p>is there a function where hirid are created? so that i can print each of them to check who is creating that bogus hirid?</p>



<a name="194245292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245292">(Apr 16 2020 at 00:28)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> look in <code>src/librustc_ast_lowering</code></p>



<a name="194245301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245301">(Apr 16 2020 at 00:29)</a>:</h4>
<p>all of <code>HirId</code> creation should be <em>somewhere</em> in there</p>



<a name="194245315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245315">(Apr 16 2020 at 00:29)</a>:</h4>
<p>searching for <code>HirId {</code> might be the easiest way to find all the places</p>



<a name="194245322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245322">(Apr 16 2020 at 00:29)</a>:</h4>
<p>can someone create an hirid after the call to init_node_id_to_hir_id_mapping?</p>



<a name="194245328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245328">(Apr 16 2020 at 00:29)</a>:</h4>
<p>not sure</p>



<a name="194245335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245335">(Apr 16 2020 at 00:30)</a>:</h4>
<p>it's a bit of a mess right now</p>



<a name="194245433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245433">(Apr 16 2020 at 00:31)</a>:</h4>
<p>haha <code>HirId {</code> matches on function that returns an HirId of course^^</p>



<a name="194245437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194245437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194245437">(Apr 16 2020 at 00:31)</a>:</h4>
<p>lol</p>



<a name="194357174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194357174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194357174">(Apr 16 2020 at 19:43)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> i created <a href="https://github.com/rust-lang/rust/pull/71215" title="https://github.com/rust-lang/rust/pull/71215">https://github.com/rust-lang/rust/pull/71215</a> as a draft because i want to see if tests passes in CI, because i am totally lost in space right now. I added another commit to remove all unnecessary <code>unwrap()</code> but i don't think it will help fix my issue</p>



<a name="194357886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194357886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194357886">(Apr 16 2020 at 19:48)</a>:</h4>
<p>ping me when CI finishes</p>



<a name="194360666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194360666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194360666">(Apr 16 2020 at 20:10)</a>:</h4>
<p>LOL tests now pass locally with the new commit</p>



<a name="194360923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194360923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194360923">(Apr 16 2020 at 20:12)</a>:</h4>
<p>uhhh oh</p>



<a name="194360963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194360963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194360963">(Apr 16 2020 at 20:13)</a>:</h4>
<p>/me gets nervous about potential miscompilation</p>



<a name="194361016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194361016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194361016">(Apr 16 2020 at 20:13)</a>:</h4>
<p>or maybe it was accidentally doing incremental at stage1? but that doesn't make much sense</p>



<a name="194361333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194361333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194361333">(Apr 16 2020 at 20:16)</a>:</h4>
<p>I do have incremental compilation enabled in my config</p>



<a name="194361420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194361420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194361420">(Apr 16 2020 at 20:16)</a>:</h4>
<p>yeah but still, it shouldn't trigger in stage1, AFAIK</p>



<a name="194362334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194362334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194362334">(Apr 16 2020 at 20:23)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> GHA tests passed <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="194364354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194364354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194364354">(Apr 16 2020 at 20:39)</a>:</h4>
<p>At some point i wondered if I should have kept <code>as_loca_hir_id(DefId) -&gt; Option&lt;HirId&gt;</code> but introduce <code>local_def_id_to_hir_id(LocalDefId) -&gt; HirId</code></p>



<a name="194364468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194364468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194364468">(Apr 16 2020 at 20:40)</a>:</h4>
<p>because all those calls to <code>as_local().map()</code> they should be abstracted over a function</p>



<a name="194364540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194364540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194364540">(Apr 16 2020 at 20:40)</a>:</h4>
<p>but at the same time, it helps to have explicitly call as_local() to identify more code that could be converted to <code>LocalDefId</code> only</p>



<a name="194365402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365402">(Apr 16 2020 at 20:48)</a>:</h4>
<p>yes :D</p>



<a name="194365662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365662">(Apr 16 2020 at 20:50)</a>:</h4>
<p>When you say <code>More .as_local().map( in if let RHS.</code></p>



<a name="194365685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365685">(Apr 16 2020 at 20:50)</a>:</h4>
<p>what do you mean exactly? I am not sure i understand</p>



<a name="194365693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365693">(Apr 16 2020 at 20:50)</a>:</h4>
<p>I thought I could annotate all the places</p>



<a name="194365701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365701">(Apr 16 2020 at 20:50)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> see the first comment</p>



<a name="194365714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365714">(Apr 16 2020 at 20:50)</a>:</h4>
<p>I gave up after a few :P</p>



<a name="194365786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365786">(Apr 16 2020 at 20:51)</a>:</h4>
<p>its about shadowing def_id with <code>if let Some(def_id) = def_id.as_local()</code> and doing to lookup for hir_id later in another variable?</p>



<a name="194365799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365799">(Apr 16 2020 at 20:51)</a>:</h4>
<p>yeah</p>



<a name="194365891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365891">(Apr 16 2020 at 20:52)</a>:</h4>
<p>Ok! Sorry i was not sure and because there are so many, I did not want to spend hours changing something that i had misunderstood</p>



<a name="194365906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194365906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194365906">(Apr 16 2020 at 20:52)</a>:</h4>
<p>np</p>



<a name="194368452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194368452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194368452">(Apr 16 2020 at 21:15)</a>:</h4>
<p>oops I should've used this feature <a href="https://github.com/rust-lang/rust/pull/71215/files?w=1" title="https://github.com/rust-lang/rust/pull/71215/files?w=1">https://github.com/rust-lang/rust/pull/71215/files?w=1</a></p>



<a name="194376967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194376967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194376967">(Apr 16 2020 at 22:42)</a>:</h4>
<p>I think i've fixed all the comments</p>



<a name="194377245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377245">(Apr 16 2020 at 22:47)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> were you able to search for all instances, not just the ones I commented on?</p>



<a name="194377272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377272">(Apr 16 2020 at 22:47)</a>:</h4>
<p>I looked for all i could find</p>



<a name="194377322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377322">(Apr 16 2020 at 22:48)</a>:</h4>
<p>okay I'll show you a trick in a sec :P</p>



<a name="194377333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377333">(Apr 16 2020 at 22:48)</a>:</h4>
<p>You can look at the commit I added, there is a few more fixes than the one you commented :P</p>



<a name="194377357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377357">(Apr 16 2020 at 22:48)</a>:</h4>
<p>I'm using the "Viewed" checkboxes</p>



<a name="194377375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377375">(Apr 16 2020 at 22:49)</a>:</h4>
<p>ah yeah saw that</p>



<a name="194377455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377455">(Apr 16 2020 at 22:50)</a>:</h4>
<p>so the trick is that you can go to this URL: <a href="https://github.com/rust-lang/rust/pull/71215.patch" title="https://github.com/rust-lang/rust/pull/71215.patch">https://github.com/rust-lang/rust/pull/71215.patch</a></p>



<a name="194377507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377507">(Apr 16 2020 at 22:51)</a>:</h4>
<p>ah but not even firefox lets me do regexes on that :P</p>



<a name="194377580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377580">(Apr 16 2020 at 22:52)</a>:</h4>
<p>anyway just searching <code>.as_local().map(|</code> I'm seeing a bunch of <code>if let</code>s</p>



<a name="194377595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377595">(Apr 16 2020 at 22:52)</a>:</h4>
<p>you might be able to do <code>git diff master</code> or something  to see the same thing locally</p>



<a name="194377605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377605">(Apr 16 2020 at 22:52)</a>:</h4>
<p>hu still?</p>



<a name="194377645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377645">(Apr 16 2020 at 22:52)</a>:</h4>
<p>wait</p>



<a name="194377661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377661">(Apr 16 2020 at 22:53)</a>:</h4>
<p>is the joke on me</p>



<a name="194377674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377674">(Apr 16 2020 at 22:53)</a>:</h4>
<p>ah yes it is</p>



<a name="194377682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377682">(Apr 16 2020 at 22:53)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> I used the wrong suffix</p>



<a name="194377706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377706">(Apr 16 2020 at 22:53)</a>:</h4>
<p>if you use <code>.diff</code> instead of <code>.patch</code> it's the entire combined diff</p>



<a name="194377770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377770">(Apr 16 2020 at 22:54)</a>:</h4>
<p>if you use <code>.patch</code>, it's usable for things like <code>git am</code>, it has the exact commit history :P</p>



<a name="194377859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377859">(Apr 16 2020 at 22:55)</a>:</h4>
<p>yep i use that trick sometime too</p>



<a name="194377867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377867">(Apr 16 2020 at 22:56)</a>:</h4>
<p>i think i've missed one or two</p>



<a name="194377915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377915">(Apr 16 2020 at 22:56)</a>:</h4>
<p>I posted a comment on two</p>



<a name="194377921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194377921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194377921">(Apr 16 2020 at 22:56)</a>:</h4>
<p>can't easily find more :P</p>



<a name="194378038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194378038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194378038">(Apr 16 2020 at 22:57)</a>:</h4>
<p>this finds exactly one of them <code>curl 'https://patch-diff.githubusercontent.com/raw/rust-lang/rust/pull/71215.diff' | rg -C10 '^\+.*if let.*=$'</code></p>



<a name="194378130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194378130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194378130">(Apr 16 2020 at 22:58)</a>:</h4>
<p>anyway yeah I think we're now ready for perf :D</p>



<a name="194378197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194378197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194378197">(Apr 16 2020 at 22:59)</a>:</h4>
<p>(after you fix the last two. just so you don't have to push again while it does its thing)</p>



<a name="194378396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194378396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194378396">(Apr 16 2020 at 23:01)</a>:</h4>
<p>i fixed your two comments, i could not find more</p>



<a name="194378417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194378417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194378417">(Apr 16 2020 at 23:01)</a>:</h4>
<p>i've pushed</p>



<a name="194378539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194378539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194378539">(Apr 16 2020 at 23:03)</a>:</h4>
<p>thanks! :D</p>



<a name="194379354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379354">(Apr 16 2020 at 23:16)</a>:</h4>
<p>Assuming that perf tests are ok, what would the next steps?</p>



<a name="194379446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379446">(Apr 16 2020 at 23:18)</a>:</h4>
<p>For example, is there query that should only accept a localdefid and never a generic defid? Because we could probably change the key</p>



<a name="194379730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379730">(Apr 16 2020 at 23:22)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> by the way <code>local_def_id_to_hir_id</code> already exists lol and <code>as_local_hir_id</code> calls it :D</p>



<a name="194379743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379743">(Apr 16 2020 at 23:22)</a>:</h4>
<p>yeah I know :P</p>



<a name="194379751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379751">(Apr 16 2020 at 23:22)</a>:</h4>
<p>I mean, I saw it on your PR</p>



<a name="194379758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379758">(Apr 16 2020 at 23:22)</a>:</h4>
<p>so we could get rid of <code>as_local_hir_id</code> entirely</p>



<a name="194379770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379770">(Apr 16 2020 at 23:23)</a>:</h4>
<p>it's a bit long, but if you like it...</p>



<a name="194379777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379777">(Apr 16 2020 at 23:23)</a>:</h4>
<p>the other thing is that I want the directions to be symmetrical</p>



<a name="194379785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379785">(Apr 16 2020 at 23:23)</a>:</h4>
<p>i.e. <code>hir_id_to_local_def_id</code></p>



<a name="194379790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379790">(Apr 16 2020 at 23:23)</a>:</h4>
<p>well, its just that it exists</p>



<a name="194379791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379791">(Apr 16 2020 at 23:23)</a>:</h4>
<p>if you pick the one you want</p>



<a name="194379829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379829">(Apr 16 2020 at 23:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281572">marmeladema</span> <a href="#narrow/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible/near/194379790" title="#narrow/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible/near/194379790">said</a>:</p>
<blockquote>
<p>well, its just that it exists</p>
</blockquote>
<p>you're rewriting the compiler, what's a little renaming :P</p>



<a name="194379841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379841">(Apr 16 2020 at 23:23)</a>:</h4>
<p>and having <code>local</code> in the name makes it pretty clear</p>



<a name="194379860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379860">(Apr 16 2020 at 23:24)</a>:</h4>
<p>yeah that is a bonus</p>



<a name="194379898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379898">(Apr 16 2020 at 23:24)</a>:</h4>
<p>actually, this is good, because eventually we want <code>LocalDefId &lt;-&gt; HirId</code> to be free</p>



<a name="194379910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194379910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194379910">(Apr 16 2020 at 23:24)</a>:</h4>
<p>i.e. each <code>LocalDefId</code> would be the root of a HIR subtree</p>



<a name="194380051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380051">(Apr 16 2020 at 23:26)</a>:</h4>
<p>so the longer name will incentivize that transition</p>



<a name="194380097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380097">(Apr 16 2020 at 23:27)</a>:</h4>
<p>and tbh a lot of functions in the compiler are longer that that already^^</p>



<a name="194380115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380115">(Apr 16 2020 at 23:27)</a>:</h4>
<p>lol</p>



<a name="194380128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380128">(Apr 16 2020 at 23:27)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> as for queries, that is easy, -ish</p>



<a name="194380198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380198">(Apr 16 2020 at 23:28)</a>:</h4>
<p>first off, you exclude <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L90-L236" title="https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L90-L236">https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L90-L236</a></p>



<a name="194380212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380212">(Apr 16 2020 at 23:28)</a>:</h4>
<p>as all of those are supported cross-crate</p>



<a name="194380252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380252">(Apr 16 2020 at 23:29)</a>:</h4>
<p>then, for the remaining queries that take <code>DefId</code>s, find where they're provided and see if they <code>expect_local</code> right away</p>



<a name="194380257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380257">(Apr 16 2020 at 23:29)</a>:</h4>
<p>those two facts combined means they can be changed to take <code>LocalDefId</code></p>



<a name="194380262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380262">(Apr 16 2020 at 23:29)</a>:</h4>
<p>ok</p>



<a name="194380333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380333">(Apr 16 2020 at 23:30)</a>:</h4>
<p>very cool thank you</p>



<a name="194380636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380636">(Apr 16 2020 at 23:35)</a>:</h4>
<p>thank you for taking this on :D</p>



<a name="194380768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194380768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194380768">(Apr 16 2020 at 23:37)</a>:</h4>
<p>I can't do anything more complicated with what i know about the compiler right now, so a bit of refactor allows me to learn a bit of things work.</p>



<a name="194409299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194409299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194409299">(Apr 17 2020 at 08:29)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> perf test is done :D</p>



<a name="194429407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194429407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194429407">(Apr 17 2020 at 12:05)</a>:</h4>
<p>aaaaaa love the noiseless :D</p>



<a name="194437627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194437627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194437627">(Apr 17 2020 at 13:14)</a>:</h4>
<p>Of the perf results?</p>



<a name="194438320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194438320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194438320">(Apr 17 2020 at 13:19)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> could / should <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_hir/lang_items.rs#L87" title="https://github.com/rust-lang/rust/blob/master/src/librustc_hir/lang_items.rs#L87">https://github.com/rust-lang/rust/blob/master/src/librustc_hir/lang_items.rs#L87</a> return an <code>Option&lt;LocalDefId&gt;</code> instead?</p>



<a name="194438426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194438426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194438426">(Apr 17 2020 at 13:20)</a>:</h4>
<p>no, lang items can be from other crates</p>



<a name="194438495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194438495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194438495">(Apr 17 2020 at 13:20)</a>:</h4>
<p>this is very sad :(</p>



<a name="194438511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194438511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194438511">(Apr 17 2020 at 13:20)</a>:</h4>
<p>e.g. when you compile regular user code, all lang items are from <code>core</code>, <code>alloc</code> and <code>std</code></p>



<a name="194438525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194438525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194438525">(Apr 17 2020 at 13:20)</a>:</h4>
<p>ok</p>



<a name="194439396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439396">(Apr 17 2020 at 13:26)</a>:</h4>
<p>I am changing <code>associated_items</code> query to accept a<code>LocalDefId</code> instead of a <code>DefId</code> but i endup adding expect_local() everywhere</p>



<a name="194439466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439466">(Apr 17 2020 at 13:27)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> that doesn't sound like a local query</p>



<a name="194439555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439555">(Apr 17 2020 at 13:27)</a>:</h4>
<p>iirc, its not in a list of external queries</p>



<a name="194439667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439667">(Apr 17 2020 at 13:28)</a>:</h4>
<p>ah, this is <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L106-L111" title="https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L106-L111">https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L106-L111</a></p>



<a name="194439752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439752">(Apr 17 2020 at 13:28)</a>:</h4>
<p>so, for <code>associated_items</code>: <a href="https://github.com/rust-lang/rust/search?q=%22fn+associated_items%22&amp;unscoped_q=%22fn+associated_items%22" title="https://github.com/rust-lang/rust/search?q=%22fn+associated_items%22&amp;unscoped_q=%22fn+associated_items%22">https://github.com/rust-lang/rust/search?q=%22fn+associated_items%22&amp;unscoped_q=%22fn+associated_items%22</a></p>



<a name="194439818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439818">(Apr 17 2020 at 13:29)</a>:</h4>
<p>Yes this is the one i am modifying</p>



<a name="194439822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439822">(Apr 17 2020 at 13:29)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> so here's the giveaway: the <code>def_id</code> isn't <code>.expect_local</code>'d, instead it's used to call a global query <a href="https://github.com/rust-lang/rust/blob/513a6473d69b3af34e6cdaa4efb288fe5283c3e9/src/librustc_ty/ty.rs#L223-L224" title="https://github.com/rust-lang/rust/blob/513a6473d69b3af34e6cdaa4efb288fe5283c3e9/src/librustc_ty/ty.rs#L223-L224">https://github.com/rust-lang/rust/blob/513a6473d69b3af34e6cdaa4efb288fe5283c3e9/src/librustc_ty/ty.rs#L223-L224</a></p>



<a name="194439859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439859">(Apr 17 2020 at 13:29)</a>:</h4>
<p>if it had <code>.expect_local</code> then you could change its signature</p>



<a name="194439946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439946">(Apr 17 2020 at 13:30)</a>:</h4>
<p>but <code>associated_item_def_ids</code> expect a local id</p>



<a name="194439978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439978">(Apr 17 2020 at 13:30)</a>:</h4>
<p>and its the first called in <code>associated_items</code></p>



<a name="194439990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194439990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194439990">(Apr 17 2020 at 13:30)</a>:</h4>
<p>no it doesn't: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L106-L111" title="https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L106-L111">https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/rmeta/decoder/cstore_impl.rs#L106-L111</a></p>



<a name="194440032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440032">(Apr 17 2020 at 13:30)</a>:</h4>
<p>oh I see</p>



<a name="194440071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440071">(Apr 17 2020 at 13:30)</a>:</h4>
<p>okay this is kind of confusing at first</p>



<a name="194440122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440122">(Apr 17 2020 at 13:31)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> the <em>function</em> <code>associated_item_def_ids</code> is the local-only provider for that query</p>



<a name="194440144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440144">(Apr 17 2020 at 13:31)</a>:</h4>
<p>but <code>tcx.associated_item_def_ids</code> can dispatch to the <code>rustc_metadata</code> provider</p>



<a name="194440164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440164">(Apr 17 2020 at 13:31)</a>:</h4>
<p>hu ooook</p>



<a name="194440184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440184">(Apr 17 2020 at 13:31)</a>:</h4>
<p>every makes much more sense now</p>



<a name="194440197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440197">(Apr 17 2020 at 13:31)</a>:</h4>
<p>phew</p>



<a name="194440297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440297">(Apr 17 2020 at 13:32)</a>:</h4>
<p>Thanks</p>



<a name="194440302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440302">(Apr 17 2020 at 13:32)</a>:</h4>
<p>/me was worried they'd make it worse</p>



<a name="194440386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440386">(Apr 17 2020 at 13:33)</a>:</h4>
<p>so identifying queries than should be converted to a local def is not that simple^^</p>



<a name="194440458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440458">(Apr 17 2020 at 13:33)</a>:</h4>
<p>yeaaaah</p>



<a name="194440498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440498">(Apr 17 2020 at 13:33)</a>:</h4>
<p>but usually the local-only stuff has <code>expect_local</code> quite early</p>



<a name="194440567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440567">(Apr 17 2020 at 13:34)</a>:</h4>
<p><code>typeck_tables_of</code>, for example, should have <code>expect_local</code> + no <code>rustc_metadata</code> counterpart</p>



<a name="194440746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194440746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194440746">(Apr 17 2020 at 13:35)</a>:</h4>
<p>Ok i'll look into this one first then</p>



<a name="194441981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194441981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194441981">(Apr 17 2020 at 13:45)</a>:</h4>
<p>Sorry to bother you with all my questions but i noticed that  <code>typeck_tables_of</code> has <code>cache_on_disk_if { key.is_local() }</code></p>



<a name="194442024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194442024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194442024">(Apr 17 2020 at 13:45)</a>:</h4>
<p>Why cache that on disk if its only available for the local crate?</p>



<a name="194442134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194442134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194442134">(Apr 17 2020 at 13:46)</a>:</h4>
<p>haha</p>



<a name="194442140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194442140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194442140">(Apr 17 2020 at 13:46)</a>:</h4>
<p>probably copy-paste</p>



<a name="194442171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194442171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194442171">(Apr 17 2020 at 13:46)</a>:</h4>
<p>idk if there's a shorthand for <code>cache_on_disk_if { true }</code></p>



<a name="194442245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194442245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194442245">(Apr 17 2020 at 13:47)</a>:</h4>
<p>but why even bother caching that? Its already in memory because its the local crate right?</p>



<a name="194442422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194442422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194442422">(Apr 17 2020 at 13:48)</a>:</h4>
<p>"on disk" means between incremental compilations</p>



<a name="194442447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194442447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194442447">(Apr 17 2020 at 13:48)</a>:</h4>
<p>completely separate system to <code>rmeta</code></p>



<a name="194442549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194442549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194442549">(Apr 17 2020 at 13:49)</a>:</h4>
<p>oh ok</p>



<a name="194443389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194443389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194443389">(Apr 17 2020 at 13:55)</a>:</h4>
<p>(one day maybe we can combine them and have <code>rmeta</code> just be a partial incremental snapshot or something)</p>



<a name="194448875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194448875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194448875">(Apr 17 2020 at 14:32)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> should <code>trait_impls</code> in <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_hir/hir.rs#L619" title="https://github.com/rust-lang/rust/blob/master/src/librustc_hir/hir.rs#L619">https://github.com/rust-lang/rust/blob/master/src/librustc_hir/hir.rs#L619</a> use <code>LocalDefId</code>?</p>



<a name="194448958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194448958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194448958">(Apr 17 2020 at 14:32)</a>:</h4>
<p>The comment for the struct states that </p>
<div class="codehilite"><pre><span></span>/// The top-level data structure that stores the entire contents of
/// the crate currently being compiled.
</pre></div>



<a name="194448960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194448960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194448960">(Apr 17 2020 at 14:32)</a>:</h4>
<p>not for the <code>DefId</code>, I believe that's the trait being implemented</p>



<a name="194448996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194448996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194448996">(Apr 17 2020 at 14:33)</a>:</h4>
<p><code>Vec&lt;HirId&gt;</code> OTOH.... could totally be <code>LocalDefId</code></p>



<a name="194449027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194449027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194449027">(Apr 17 2020 at 14:33)</a>:</h4>
<p>same for modules and proc macros</p>



<a name="194449088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194449088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194449088">(Apr 17 2020 at 14:33)</a>:</h4>
<p>stuff like this lol <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_hir/hir.rs#L1793" title="https://github.com/rust-lang/rust/blob/master/src/librustc_hir/hir.rs#L1793">https://github.com/rust-lang/rust/blob/master/src/librustc_hir/hir.rs#L1793</a></p>



<a name="194449210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194449210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194449210">(Apr 17 2020 at 14:34)</a>:</h4>
<p><code>ItemId</code>, <code>ImplItemId</code> and <code>TraitItemId</code> could all hold <code>LocalDefId</code>s</p>



<a name="194449217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194449217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194449217">(Apr 17 2020 at 14:34)</a>:</h4>
<p>instead of <code>HirId</code>s</p>



<a name="194449613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194449613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194449613">(Apr 17 2020 at 14:36)</a>:</h4>
<p>Dunno if that would help for my current "problem". I trying to check if <code>trait_impls_of</code> is purely local or not</p>



<a name="194449637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194449637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194449637">(Apr 17 2020 at 14:36)</a>:</h4>
<p>sorry</p>



<a name="194449663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194449663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194449663">(Apr 17 2020 at 14:36)</a>:</h4>
<p>it's not local</p>



<a name="194449685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194449685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194449685">(Apr 17 2020 at 14:37)</a>:</h4>
<p>thanks^^</p>



<a name="194450211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194450211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194450211">(Apr 17 2020 at 14:40)</a>:</h4>
<p>ah i think <code>def_span</code> should take a local def id because its unwrap() if not local</p>



<a name="194450284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194450284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194450284">(Apr 17 2020 at 14:40)</a>:</h4>
<p><code>def_span</code> is in the <code>rustc_metadata</code> list :P</p>



<a name="194450351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194450351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194450351">(Apr 17 2020 at 14:41)</a>:</h4>
<p>oh but its a query?</p>



<a name="194450413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194450413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194450413">(Apr 17 2020 at 14:41)</a>:</h4>
<p>damn, i missed that</p>



<a name="194481583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194481583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194481583">(Apr 17 2020 at 18:27)</a>:</h4>
<p>oh no my PR broke clippy</p>



<a name="194482270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194482270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194482270">(Apr 17 2020 at 18:32)</a>:</h4>
<p>that's normal, until we switch to <code>git subtree</code></p>



<a name="194497025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194497025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194497025">(Apr 17 2020 at 20:41)</a>:</h4>
<p>I am right to think that <code>mir_borrowck</code> query should take a <code>LocalDefId</code>?</p>



<a name="194497137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194497137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194497137">(Apr 17 2020 at 20:42)</a>:</h4>
<p>As well as probably <code>mir_validated</code></p>



<a name="194540282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540282">(Apr 18 2020 at 11:44)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> i am trying to convert a <code>DefIdSet</code> to a <code>FxHashSet&lt;LocalDefId&gt;</code>but it triggers an error because it does not implement a train for <code>ArenaAllocatable</code></p>



<a name="194540288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540288">(Apr 18 2020 at 11:45)</a>:</h4>
<div class="codehilite"><pre><span></span>ArenaAllocatable` is not satisfied
  --&gt; src/librustc_mir/transform/mod.rs:97:21
   |
97 |     tcx.arena.alloc(set)
   |                     ^^^
   |                     |
   |                     expected an implementor of trait `rustc_middle::arena::ArenaAllocatable`
   |                     help: consider borrowing here: `&amp;set`
   |
   = note: required because of the requirements on the impl of `rustc_middle::arena::ArenaAllocatable` for `std::collections::HashSet&lt;rustc_span::def_id::LocalDefId, std::hash::BuildHasherDefault&lt;rustc_hash::FxHasher&gt;&gt;`
</pre></div>



<a name="194540290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540290">(Apr 18 2020 at 11:45)</a>:</h4>
<p>there's a thing somewhere</p>



<a name="194540292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540292">(Apr 18 2020 at 11:45)</a>:</h4>
<p>lemme find it</p>



<a name="194540297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540297">(Apr 18 2020 at 11:45)</a>:</h4>
<p>I grepped <code>ArenaAllocatable</code> but what i found wasnt very useful</p>



<a name="194540344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540344">(Apr 18 2020 at 11:46)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/librustc_middle/arena.rs#L37" title="https://github.com/rust-lang/rust/blob/master/src/librustc_middle/arena.rs#L37">https://github.com/rust-lang/rust/blob/master/src/librustc_middle/arena.rs#L37</a></p>



<a name="194540355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540355">(Apr 18 2020 at 11:47)</a>:</h4>
<p>we should also remove <code>{DefId,Node}{Map,Set}</code> and any other aliases</p>



<a name="194540392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540392">(Apr 18 2020 at 11:48)</a>:</h4>
<p>they offer no benefits IMO</p>



<a name="194540395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540395">(Apr 18 2020 at 11:48)</a>:</h4>
<p>Ok, i might do that but in another PR</p>



<a name="194540704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540704">(Apr 18 2020 at 11:56)</a>:</h4>
<p>great that works fine! Thank you!</p>



<a name="194540942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540942">(Apr 18 2020 at 12:02)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> about <code>mir_validated</code> and <code>mir_borrowck</code> taking a LocalDefId, does that seem sensible?</p>



<a name="194540983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540983">(Apr 18 2020 at 12:02)</a>:</h4>
<p>probably, yeah</p>



<a name="194540996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194540996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194540996">(Apr 18 2020 at 12:02)</a>:</h4>
<p>since those only happen locally, and only <code>optimized_mir</code>, I think, is serialized cross-crate</p>



<a name="194541005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194541005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194541005">(Apr 18 2020 at 12:03)</a>:</h4>
<p><code>mir_borrowck</code> definitely, <code>mir_validated</code> only if <code>rmeta::encoder</code> doesn't mention it</p>



<a name="194541012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194541012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194541012">(Apr 18 2020 at 12:03)</a>:</h4>
<p>ok</p>



<a name="194541021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194541021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194541021">(Apr 18 2020 at 12:03)</a>:</h4>
<p>(but I suspect it doesn't)</p>



<a name="194547237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547237">(Apr 18 2020 at 14:27)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> when do you think <a href="https://github.com/rust-lang/rust/pull/71215" title="https://github.com/rust-lang/rust/pull/71215">https://github.com/rust-lang/rust/pull/71215</a> will land? I am starting to have quite of a long list of commits locally on top of this</p>



<a name="194547250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547250">(Apr 18 2020 at 14:27)</a>:</h4>
<p>oh drat we were too late</p>



<a name="194547251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547251">(Apr 18 2020 at 14:27)</a>:</h4>
<p>next week, after the next version of Rust is released</p>



<a name="194547299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547299">(Apr 18 2020 at 14:28)</a>:</h4>
<p>it's fine to base a new PR on top of it, since it was approved</p>



<a name="194547303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547303">(Apr 18 2020 at 14:28)</a>:</h4>
<p><code>git subtree</code> can't come soon enough Q_Q</p>



<a name="194547312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547312">(Apr 18 2020 at 14:28)</a>:</h4>
<p>Hum, in this case, should the target branch be master or my already approved branch?</p>



<a name="194547331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547331">(Apr 18 2020 at 14:29)</a>:</h4>
<p>oh that's always <code>master</code>, you'd just note in the PR description that it's based on another PR</p>



<a name="194547333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547333">(Apr 18 2020 at 14:29)</a>:</h4>
<p>and we have the label S-blocked now</p>



<a name="194547411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547411">(Apr 18 2020 at 14:31)</a>:</h4>
<p>ok</p>



<a name="194547607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547607">(Apr 18 2020 at 14:35)</a>:</h4>
<p>About <code>entry_fn</code> query, it takes a cratenum as argument, but i _think_ i've only see it called with <code>CRATE_LOCAL</code></p>



<a name="194547670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194547670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194547670">(Apr 18 2020 at 14:36)</a>:</h4>
<p>So should it does not take any argument and return a LocalDefId? Or could i introduce a <code>local_entry_fn</code> query to return such a LocalDefId?</p>



<a name="194549271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549271">(Apr 18 2020 at 15:12)</a>:</h4>
<p>the argument doesn't matter although we might want to change it idk</p>



<a name="194549275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549275">(Apr 18 2020 at 15:12)</a>:</h4>
<p>it should return <code>LocalDefId</code> though</p>



<a name="194549393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549393">(Apr 18 2020 at 15:14)</a>:</h4>
<p>Hum can it return a LocalDefId if you request the entrypoint of a crate that is not the local one?</p>



<a name="194549433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549433">(Apr 18 2020 at 15:15)</a>:</h4>
<p>you can't do that</p>



<a name="194549439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549439">(Apr 18 2020 at 15:15)</a>:</h4>
<p>there are a bunch of <code>CrateNum</code> arguments that are always <code>LOCAL_CRATE</code></p>



<a name="194549489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549489">(Apr 18 2020 at 15:16)</a>:</h4>
<p>maybe they should be <code>()</code> or some <code>struct LocalCrate;</code> idk</p>



<a name="194549496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549496">(Apr 18 2020 at 15:16)</a>:</h4>
<p>but if we change them, we should change them all at once otherwise it would be confusing</p>



<a name="194549499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549499">(Apr 18 2020 at 15:16)</a>:</h4>
<p>Oh ok, it a bit weird to even have an argument then no? If it fails with any other value than the current crate</p>



<a name="194549510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549510">(Apr 18 2020 at 15:16)</a>:</h4>
<p>we didn't support <code>()</code> arguments back when they were added</p>



<a name="194549513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549513">(Apr 18 2020 at 15:17)</a>:</h4>
<p>I understand, i can add an assert in entry_fn as start that enforce that the argument is local crate</p>



<a name="194549523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549523">(Apr 18 2020 at 15:17)</a>:</h4>
<p>oh yeah they should all have it</p>



<a name="194549525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549525">(Apr 18 2020 at 15:17)</a>:</h4>
<p>in the mean time</p>



<a name="194549533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549533">(Apr 18 2020 at 15:17)</a>:</h4>
<p>Ok  sounds good</p>



<a name="194549537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549537">(Apr 18 2020 at 15:17)</a>:</h4>
<p>if one of the queries that takes <code>CrateNum</code> (and is only used with <code>LOCAL_CRATE</code>) is missing one of those asserts, that's a mistake</p>



<a name="194549544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549544">(Apr 18 2020 at 15:17)</a>:</h4>
<p>I am slowly converting queries to local_def_id and removing expect_local where i can</p>



<a name="194549595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549595">(Apr 18 2020 at 15:18)</a>:</h4>
<p>entry_fn i am not sure exactly, but from what i've seen its only called with LOCAL_CRATE</p>



<a name="194549604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549604">(Apr 18 2020 at 15:18)</a>:</h4>
<p>yeah that makes sense, we only search for <code>fn main</code> within one crate</p>



<a name="194549635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549635">(Apr 18 2020 at 15:19)</a>:</h4>
<p>anyway, making the proc macro that you use to define queries allow argument counts != 1 and tupling them for the internals (but not for the <code>tcx</code> methods) would make this more sensible</p>



<a name="194549638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549638">(Apr 18 2020 at 15:19)</a>:</h4>
<p>because you'd call <code>tcx.entry_fn()</code></p>



<a name="194549686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194549686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194549686">(Apr 18 2020 at 15:20)</a>:</h4>
<p>but that's more effort</p>



<a name="194554005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194554005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194554005">(Apr 18 2020 at 17:01)</a>:</h4>
<p>So <span class="user-mention" data-user-id="119009">@eddyb</span>  here we go: <a href="https://github.com/rust-lang/rust/pull/71292" title="https://github.com/rust-lang/rust/pull/71292">https://github.com/rust-lang/rust/pull/71292</a><br>
I made one commit per query (sometime I cheated and handled 2 queries in one commit I have to admit :p)</p>



<a name="194554103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194554103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194554103">(Apr 18 2020 at 17:03)</a>:</h4>
<p>I am starting to lack of ideas on how to find places that i could convert to use <code>LocalDefId</code></p>



<a name="194586217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194586217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194586217">(Apr 19 2020 at 08:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281572">marmeladema</span> <a href="#narrow/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible/near/194481583" title="#narrow/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible/near/194481583">said</a>:</p>
<blockquote>
<p>oh no my PR broke clippy</p>
</blockquote>
<p>another (or the same) PR also broke Miri. it's fine, the fix wasnt hard. ;)</p>



<a name="194586578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194586578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194586578">(Apr 19 2020 at 08:45)</a>:</h4>
<p>Oh sorry it that was me, but yeah i changed / am changing some methods prototype about hird / defid etc so anyone using those will be broken :/</p>



<a name="194586632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194586632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194586632">(Apr 19 2020 at 08:46)</a>:</h4>
<p>This one <a href="https://github.com/rust-lang/rust/pull/71292" title="https://github.com/rust-lang/rust/pull/71292">https://github.com/rust-lang/rust/pull/71292</a> might also break miri again</p>



<a name="194592569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194592569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194592569">(Apr 19 2020 at 11:20)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> i rebased over master in both PR. The perf results look good by the way: <a href="https://perf.rust-lang.org/compare.html?start=339a938fa6582d5c6f84d811680a1031c684c1c6&amp;end=a70b0e7f3482873f39970306a89e352ead61b4f5" title="https://perf.rust-lang.org/compare.html?start=339a938fa6582d5c6f84d811680a1031c684c1c6&amp;end=a70b0e7f3482873f39970306a89e352ead61b4f5">https://perf.rust-lang.org/compare.html?start=339a938fa6582d5c6f84d811680a1031c684c1c6&amp;end=a70b0e7f3482873f39970306a89e352ead61b4f5</a></p>



<a name="194593575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194593575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194593575">(Apr 19 2020 at 11:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281572">marmeladema</span> <a href="#narrow/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible/near/194586578" title="#narrow/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible/near/194586578">said</a>:</p>
<blockquote>
<p>Oh sorry it that was me, but yeah i changed / am changing some methods prototype about hird / defid etc so anyone using those will be broken :/</p>
</blockquote>
<p>that's okay, this happens with refactorings :)</p>



<a name="194593597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194593597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194593597">(Apr 19 2020 at 11:47)</a>:</h4>
<p>the hardest part of me usually is figuring out from the PR what the pattern  is -- typically the actual fix is quite mechanical. For example for <a href="https://github.com/rust-lang/miri/pull/1327" title="https://github.com/rust-lang/miri/pull/1327">https://github.com/rust-lang/miri/pull/1327</a> I had to learn about <code>to_def_id</code>.</p>



<a name="194593639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194593639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194593639">(Apr 19 2020 at 11:48)</a>:</h4>
<p>so if the PR description says something like "to fix tools, you likely just need to insert <code>to_def_id()</code> in places where typechecking fails", that helps a lot</p>



<a name="194593655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194593655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194593655">(Apr 19 2020 at 11:49)</a>:</h4>
<p>Also Cc'ing tool maintainers <em>after the PR landed</em> can help, so we can more quickly identify the PR. (please not before that, the actual PR review discussion would just be noise in my inbox.^^)</p>



<a name="194593657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194593657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194593657">(Apr 19 2020 at 11:49)</a>:</h4>
<p>Oh yeah i should have though about that! I'll keep that in mind!</p>



<a name="194593830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194593830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194593830">(Apr 19 2020 at 11:53)</a>:</h4>
<p>So <span class="user-mention" data-user-id="120791">@RalfJ</span> i assume you maintain miri. Who else should cc for other tools?</p>



<a name="194594250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194594250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194594250">(Apr 19 2020 at 12:04)</a>:</h4>
<p>looks like <code>@matthiaskrgr</code> usually does the rustup for clippy</p>



<a name="194594251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194594251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194594251">(Apr 19 2020 at 12:04)</a>:</h4>
<p>(my GH handle is <code>@RalfJung</code>)</p>



<a name="194594256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194594256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194594256">(Apr 19 2020 at 12:04)</a>:</h4>
<p>not sure if any other tool would be affected?</p>



<a name="194595111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194595111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194595111">(Apr 19 2020 at 12:26)</a>:</h4>
<p>Ok thanks. I'll tag both of you in the PRs when its merged.</p>



<a name="194596897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194596897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194596897">(Apr 19 2020 at 13:09)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> thanks &lt;3</p>



<a name="194616319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194616319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194616319">(Apr 19 2020 at 20:21)</a>:</h4>
<p>Oh no conflicts again. When does the beta freeze ends?^^</p>



<a name="194617593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194617593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194617593">(Apr 19 2020 at 20:53)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> <a href="https://forge.rust-lang.org/" title="https://forge.rust-lang.org/">https://forge.rust-lang.org/</a></p>



<a name="194620317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194620317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194620317">(Apr 19 2020 at 22:11)</a>:</h4>
<p>Oh thank you, i was not aware of that forge :)</p>



<a name="194896262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194896262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194896262">(Apr 22 2020 at 07:28)</a>:</h4>
<p>Is the no breaking week over? According to the forge, it should but i don't think the new release is out yet?</p>



<a name="194896681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194896681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194896681">(Apr 22 2020 at 07:34)</a>:</h4>
<p>also <span class="user-mention" data-user-id="119009">@eddyb</span> can i re-approve the PR "myself" but tagging you? I've other seen people do something like "@bors r=eddyb"</p>



<a name="194950709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194950709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194950709">(Apr 22 2020 at 15:45)</a>:</h4>
<p>Only org members can order bors around. I've added it back to the queue. Beta branched yesterday BTW. That happens before the previous beta gets promoted to stable</p>



<a name="194953283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194953283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194953283">(Apr 22 2020 at 16:03)</a>:</h4>
<p>Ok thank you for the explanations!</p>



<a name="194953550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/194953550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#194953550">(Apr 22 2020 at 16:05)</a>:</h4>
<p>I believe that an org member can give someone the permission to approve a particular PR. But I haven't seen that often <span aria-label="eyes" class="emoji emoji-1f440" role="img" title="eyes">:eyes:</span></p>



<a name="195030428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195030428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195030428">(Apr 23 2020 at 08:21)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> <span class="user-mention" data-user-id="119009">@eddyb</span> just rebased <a href="https://github.com/rust-lang/rust/pull/71215" title="https://github.com/rust-lang/rust/pull/71215">https://github.com/rust-lang/rust/pull/71215</a></p>



<a name="195102285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195102285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195102285">(Apr 23 2020 at 18:39)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> Another merge conflict <span aria-label="oops" class="emoji emoji-1f643" role="img" title="oops">:oops:</span>. Sorry about the bad luck. Once you rebase you'll be at the top of the queue again.</p>



<a name="195102466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195102466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195102466">(Apr 23 2020 at 18:41)</a>:</h4>
<p>Thanks again for working on this! I was very happy to see how fast you resolved most of <a href="https://github.com/rust-lang/rust/issues/70853" title="https://github.com/rust-lang/rust/issues/70853">#70853</a> between <a href="https://github.com/rust-lang/rust/issues/71215" title="https://github.com/rust-lang/rust/issues/71215">#71215</a> and <a href="https://github.com/rust-lang/rust/issues/71292" title="https://github.com/rust-lang/rust/issues/71292">#71292</a></p>



<a name="195102742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195102742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195102742">(Apr 23 2020 at 18:43)</a>:</h4>
<p>haha no worries, i am rebasing right now lets hope i won't mess up anything^^</p>



<a name="195108644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195108644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195108644">(Apr 23 2020 at 19:30)</a>:</h4>
<p>running the tests locally as we speak :)</p>



<a name="195108734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195108734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195108734">(Apr 23 2020 at 19:31)</a>:</h4>
<p>i can't wait for my new laptop to arrive so that i can compile faster</p>



<a name="195110113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195110113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195110113">(Apr 23 2020 at 19:43)</a>:</h4>
<p>Rebase is done for <a href="https://github.com/rust-lang/rust/pull/71215" title="https://github.com/rust-lang/rust/pull/71215">https://github.com/rust-lang/rust/pull/71215</a></p>



<a name="195110327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195110327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195110327">(Apr 23 2020 at 19:45)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> lets hope next rollup won't conflict again</p>



<a name="195110409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195110409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195110409">(Apr 23 2020 at 19:45)</a>:</h4>
<p>hu build were cancelled?</p>



<a name="195110416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195110416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195110416">(Apr 23 2020 at 19:45)</a>:</h4>
<p>I am doomed lol</p>



<a name="195110662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195110662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195110662">(Apr 23 2020 at 19:47)</a>:</h4>
<p>Maybe a CI issue, try <code>git commit --amend --no-edit --date "$(date)"</code> followed by a force push?</p>



<a name="195110854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195110854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195110854">(Apr 23 2020 at 19:49)</a>:</h4>
<p>Done! <span aria-label="fingers crossed" class="emoji emoji-1f91e" role="img" title="fingers crossed">:fingers_crossed:</span> <br>
Thank you help helping me through this</p>



<a name="195112049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195112049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195112049">(Apr 23 2020 at 20:00)</a>:</h4>
<p>hum cancelled again. I think GHA is having a hard time</p>



<a name="195112858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195112858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195112858">(Apr 23 2020 at 20:06)</a>:</h4>
<p>Oh well. BACK IN THE QUEUE.</p>



<a name="195125180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195125180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195125180">(Apr 23 2020 at 22:05)</a>:</h4>
<p>Apparently there are errors while building librustdoc: <a href="https://dev.azure.com/rust-lang/rust/_build/results?buildId=27278&amp;view=logs&amp;j=74054d28-c774-5fab-ecc2-352fe71b230e&amp;t=6fac545a-db64-5c3f-de7a-e9f2d46d7eae" title="https://dev.azure.com/rust-lang/rust/_build/results?buildId=27278&amp;view=logs&amp;j=74054d28-c774-5fab-ecc2-352fe71b230e&amp;t=6fac545a-db64-5c3f-de7a-e9f2d46d7eae">https://dev.azure.com/rust-lang/rust/_build/results?buildId=27278&amp;view=logs&amp;j=74054d28-c774-5fab-ecc2-352fe71b230e&amp;t=6fac545a-db64-5c3f-de7a-e9f2d46d7eae</a></p>



<a name="195125211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195125211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195125211">(Apr 23 2020 at 22:05)</a>:</h4>
<p>but I don't know how to build it myself locally to fix the errors</p>



<a name="195126071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195126071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195126071">(Apr 23 2020 at 22:14)</a>:</h4>
<p>I might just have to rebase again to reproduce the CI errors</p>



<a name="195128644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195128644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195128644">(Apr 23 2020 at 22:44)</a>:</h4>
<p>Rebased <a href="https://github.com/rust-lang/rust/pull/71215" title="https://github.com/rust-lang/rust/pull/71215">https://github.com/rust-lang/rust/pull/71215</a> again. Its starting to be boring to rebase all the time :o</p>



<a name="195129038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195129038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195129038">(Apr 23 2020 at 22:50)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> if you could approve one more time that would be awesome</p>



<a name="195154819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195154819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195154819">(Apr 24 2020 at 07:38)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> the first PR got merged. I cc'ed you on it to warn you that it might break miri.</p>



<a name="195278763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195278763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195278763">(Apr 25 2020 at 10:29)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> <span class="user-mention" data-user-id="118594">@ecstatic-morse</span> do you think you will have some time to take a look at <a href="https://github.com/rust-lang/rust/pull/71292" title="https://github.com/rust-lang/rust/pull/71292">https://github.com/rust-lang/rust/pull/71292</a>?</p>



<a name="195287102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195287102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195287102">(Apr 25 2020 at 14:26)</a>:</h4>
<p>I read through it and for all the parts of the compiler I'm familiar with it looks correct. You'll want eddy to review the rest though.</p>



<a name="195380612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195380612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195380612">(Apr 27 2020 at 07:22)</a>:</h4>
<p>sorry, I've been ignoring Rust stuff for the past week, looking at it now!</p>



<a name="195383149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383149">(Apr 27 2020 at 07:52)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> alright, is this PR the only thing you had waiting on me?</p>



<a name="195383190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383190">(Apr 27 2020 at 07:52)</a>:</h4>
<p>Yep :) At least for me</p>



<a name="195383203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383203">(Apr 27 2020 at 07:53)</a>:</h4>
<p>Thanks, I'll fix the formatting nit and rebase over master</p>



<a name="195383314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383314">(Apr 27 2020 at 07:54)</a>:</h4>
<p>Oh right you already approved! Thanks!</p>



<a name="195383579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383579">(Apr 27 2020 at 07:58)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> If you want more, there's <a href="https://github.com/rust-lang/rust/issues/71205" title="https://github.com/rust-lang/rust/issues/71205">#71205</a> <span aria-label="innocent" class="emoji emoji-1f607" role="img" title="innocent">:innocent:</span></p>



<a name="195383756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383756">(Apr 27 2020 at 08:00)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> that will have to wait with everything else in my GH notifications</p>



<a name="195383776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383776">(Apr 27 2020 at 08:00)</a>:</h4>
<p>I was asking for something related, just because it's easier to do it first</p>



<a name="195383792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383792">(Apr 27 2020 at 08:01)</a>:</h4>
<p>and also <span class="user-mention" data-user-id="281572">@marmeladema</span> has been waiting for me for the past week</p>



<a name="195383809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383809">(Apr 27 2020 at 08:01)</a>:</h4>
<p>Yeah, I see you have 30+ PRs assigned to you <span aria-label="rolling eyes" class="emoji emoji-1f644" role="img" title="rolling eyes">:rolling_eyes:</span></p>



<a name="195383827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383827">(Apr 27 2020 at 08:01)</a>:</h4>
<p>I do? dear lord</p>



<a name="195383863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195383863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195383863">(Apr 27 2020 at 08:01)</a>:</h4>
<p>Good luck :D</p>



<a name="195392980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195392980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195392980">(Apr 27 2020 at 09:33)</a>:</h4>
<p>partey <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="195531906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195531906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195531906">(Apr 28 2020 at 08:19)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> i've cc'ed you in the PR, but I broke miri again</p>



<a name="195532008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195532008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195532008">(Apr 28 2020 at 08:21)</a>:</h4>
<p>I've never built miri but i guess i could try to fix it myself</p>



<a name="195591391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195591391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195591391">(Apr 28 2020 at 16:39)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> here is a proposal to replace the argument type of entry_fn  to <code>()</code>: <a href="https://github.com/rust-lang/rust/pull/71648" title="https://github.com/rust-lang/rust/pull/71648">https://github.com/rust-lang/rust/pull/71648</a></p>



<a name="195591421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195591421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195591421">(Apr 28 2020 at 16:39)</a>:</h4>
<p>just that one :P?</p>



<a name="195591541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195591541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195591541">(Apr 28 2020 at 16:40)</a>:</h4>
<p>haha i wanted to check first if that was fine :) i'll do some more if the approach is sensible</p>



<a name="195591659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195591659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195591659">(Apr 28 2020 at 16:41)</a>:</h4>
<p>Especially, i had to implement the <code>Key</code> trait for <code>()</code></p>



<a name="195593975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195593975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195593975">(Apr 28 2020 at 16:57)</a>:</h4>
<p>Huhu niko answer about "no local crate" made think for a second that all the work i did to try to convert most things to <code>LocalDefId</code> was useless :'(</p>



<a name="195594052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195594052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195594052">(Apr 28 2020 at 16:57)</a>:</h4>
<p>haha no</p>



<a name="195594120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195594120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195594120">(Apr 28 2020 at 16:58)</a>:</h4>
<p>that is far into the future at the pace we're moving at</p>



<a name="195594148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195594148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195594148">(Apr 28 2020 at 16:58)</a>:</h4>
<p>and it's more useful in the interim than just using <code>DefId</code> everywhere</p>



<a name="195594231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195594231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195594231">(Apr 28 2020 at 16:58)</a>:</h4>
<p><span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="195863779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195863779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195863779">(Apr 30 2020 at 16:19)</a>:</h4>
<p>Is there a reason why <code>codegen_fn_attrs</code> takes a <code>DefId</code> as its argument? Will it be called for non-local IDs? Or is it because you haven't already reached it?</p>



<a name="195863936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195863936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195863936">(Apr 30 2020 at 16:20)</a>:</h4>
<p>I mean, for the time being, is it safe to just slap a <code>.expect_local()</code> in here?</p>



<a name="195863957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195863957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195863957">(Apr 30 2020 at 16:20)</a>:</h4>
<p>It will be called for foreign statics to know if they are for example <code>#[thread_local]</code>.</p>



<a name="195864013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864013">(Apr 30 2020 at 16:20)</a>:</h4>
<p>I need it for <code>#[target_feature]</code></p>



<a name="195864114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864114">(Apr 30 2020 at 16:21)</a>:</h4>
<p>I'd expect you can't have <code>#[target_feature]</code> on a foreign static, right?</p>



<a name="195864289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864289">(Apr 30 2020 at 16:23)</a>:</h4>
<p>It may be possible that <code>codegen_fn_attrs</code> is the one to perform that validation.</p>



<a name="195864305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864305">(Apr 30 2020 at 16:23)</a>:</h4>
<p><code>#[target_feature]</code> is applied to <code>#[inline]</code> intrinsics in stdsimd, which means that they are often codegened from the foreign crate libcore.</p>



<a name="195864340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864340">(Apr 30 2020 at 16:23)</a>:</h4>
<p>I'm gonna read the code then <span aria-label="eyes" class="emoji emoji-1f440" role="img" title="eyes">:eyes:</span></p>



<a name="195864352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864352">(Apr 30 2020 at 16:23)</a>:</h4>
<p>Thanks for the answers!</p>



<a name="195864381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864381">(Apr 30 2020 at 16:23)</a>:</h4>
<p>np</p>



<a name="195864579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864579">(Apr 30 2020 at 16:25)</a>:</h4>
<p>Hmm, I don't think it is in <code>codegen_fn_attrs</code></p>



<a name="195864600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864600">(Apr 30 2020 at 16:25)</a>:</h4>
<p>I remember seeing that kind of checks</p>



<a name="195864608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195864608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195864608">(Apr 30 2020 at 16:25)</a>:</h4>
<p>But not there</p>



<a name="195865260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195865260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195865260">(Apr 30 2020 at 16:30)</a>:</h4>
<p>Oh that's <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_passes/check_attr.rs#L201" title="https://github.com/rust-lang/rust/blob/master/src/librustc_passes/check_attr.rs#L201"><code>rustc_passes::check_attr::check_target_feature</code></a></p>



<a name="195932647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195932647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195932647">(May 01 2020 at 05:06)</a>:</h4>
<p>isn't codegen_fn_attrs saved cross-crate?</p>



<a name="195932682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195932682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195932682">(May 01 2020 at 05:06)</a>:</h4>
<p>oh huh no</p>



<a name="195932687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195932687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195932687">(May 01 2020 at 05:07)</a>:</h4>
<p>I guess all it needs is available cross-crate</p>



<a name="195932711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195932711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195932711">(May 01 2020 at 05:07)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> anyway, it's used all the time with functions, not just statics, cross-crate</p>



<a name="195932755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195932755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195932755">(May 01 2020 at 05:08)</a>:</h4>
<p>since it's what, uhh, codegen uses :P</p>



<a name="195932761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195932761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195932761">(May 01 2020 at 05:08)</a>:</h4>
<p>to check various properties of functions</p>



<a name="195945248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195945248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195945248">(May 01 2020 at 09:42)</a>:</h4>
<p>So if I need to do checking only, I can do that check if the ID is local? I'd assume that if you pass a cross-crate ID, that crate would already have been checked?</p>



<a name="195946435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195946435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195946435">(May 01 2020 at 09:59)</a>:</h4>
<p>that makes sense... ideally this would be split :/</p>



<a name="195946447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195946447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195946447">(May 01 2020 at 09:59)</a>:</h4>
<p>and/or the query cached cross-crate</p>



<a name="195947482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/195947482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#195947482">(May 01 2020 at 10:15)</a>:</h4>
<p>Alright, thanks a lot for the clarifications <span class="user-mention silent" data-user-id="119009">eddyb</span></p>



<a name="196063511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/196063511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#196063511">(May 02 2020 at 18:10)</a>:</h4>
<p>I might have a "fix" for <a href="https://github.com/rust-lang/rust/issues/71104" title="https://github.com/rust-lang/rust/issues/71104">#71104</a> !</p>



<a name="196064152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/196064152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#196064152">(May 02 2020 at 18:28)</a>:</h4>
<p>well ... a partial fix^^</p>



<a name="196070461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/196070461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#196070461">(May 02 2020 at 21:17)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> if you have some time. I tried to fix that fixme i added in <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_privacy/lib.rs#L947" title="https://github.com/rust-lang/rust/blob/master/src/librustc_privacy/lib.rs#L947">https://github.com/rust-lang/rust/blob/master/src/librustc_privacy/lib.rs#L947</a><br>
I replaced the call to <code>opt_local_def_id_to_hir_id</code> by <code>as_local_hir_id</code> to reproduce the crash. It crashes for a rustdoc test: <a href="https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/macro-in-closure.rs" title="https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/macro-in-closure.rs">https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/macro-in-closure.rs</a></p>
<p>I added some debug info to print the node_id&lt;-&gt;def_id and node_id&lt;-&gt;hir_id tables: <a href="https://paste.ee/p/ESN8m" title="https://paste.ee/p/ESN8m">https://paste.ee/p/ESN8m</a></p>
<p>I believe that individually node_id&lt;-&gt;def_id tables and node_id&lt;-&gt;hir_id tables are valid. Its when going from def_id to hir_id that it crashes because both set of tables are not in sync</p>



<a name="196070661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/196070661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#196070661">(May 02 2020 at 21:22)</a>:</h4>
<p>Because node_id_to_hir_id and hir_id_to_node_id seems to only be set once in <code>init_node_id_to_hir_id_mapping</code>, my best guess is that there is bug around <code>create_def_with_parent</code> which seems to be the only function that manipulate <code>def_id_to_node_id</code> and <code>node_id_to_def_id</code></p>



<a name="196071995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/196071995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#196071995">(May 02 2020 at 22:00)</a>:</h4>
<p>My investigations have lead to <code>librustc_resolve</code> which add new def_id without adding corresponding hir_id</p>



<a name="196072036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/196072036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#196072036">(May 02 2020 at 22:00)</a>:</h4>
<p>it must be on purpose?</p>



<a name="202035357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/202035357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#202035357">(Jun 25 2020 at 22:55)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> trying to catch up, what's the status of this? also, I should've suggested PMs, those generally work better for me...</p>



<a name="202036587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/202036587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#202036587">(Jun 25 2020 at 23:13)</a>:</h4>
<p>So i  made some progress with <a href="https://github.com/rust-lang/rust/issues/50928">https://github.com/rust-lang/rust/issues/50928</a> which ultimately got closed. Dealing with that issue made me promote LocalDefId in more places. I also converted save_analysis to use hir tree</p>



<a name="202036709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/202036709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#202036709">(Jun 25 2020 at 23:15)</a>:</h4>
<p>But strictly speaking about <a href="https://github.com/rust-lang/rust/issues/70853">https://github.com/rust-lang/rust/issues/70853</a> its not clear what remains to be changed.</p>



<a name="202038182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/202038182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#202038182">(Jun 25 2020 at 23:39)</a>:</h4>
<p>fair enough, thanks</p>



<a name="202182050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/202182050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#202182050">(Jun 27 2020 at 11:42)</a>:</h4>
<p>had some time today and propagated a few more <code>expect_local</code>s upwards: <a href="https://github.com/rust-lang/rust/pull/73796">https://github.com/rust-lang/rust/pull/73796</a></p>



<a name="202182159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LocalDefId%20instead%20of%20DefId%20where%20possible/near/202182159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LocalDefId.20instead.20of.20DefId.20where.20possible.html#202182159">(Jun 27 2020 at 11:45)</a>:</h4>
<p>there are still a few calls which I did not look at, so there is still work to do here</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>